﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

public partial class DrawPies : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int width = 300, height = 250;
        int x = 0, y = 10;
        int R_width = 150, R_height = 100;
        int startAngle = 30, sweepAngle = 120;

        Rectangle rect = new Rectangle(0, 0, R_width, R_height);
        using (Bitmap bmp=new Bitmap(width,height))
        {
            using(Graphics g=Graphics.FromImage(bmp))
            {
                g.Clear(Color.White);
                using (Pen pen=new Pen(Color.Blue,5))
                {
                    g.DrawPie(pen, rect, startAngle, sweepAngle);
                    g.DrawPie(pen, x, y, R_width, R_height, startAngle, sweepAngle);
                    bmp.Save(this.Server.MapPath("temp\\" + "Pies.Png"),
                        System.Drawing.Imaging.ImageFormat.Png);
                    Image1.ImageUrl = "temp\\Pies.Png";
                }
            }//end
        }//end
    }//end
}